<div class="wp tm20">
    <div class="typenav cl">
        <ul class="z cl pxbox">
        <?php
            $this->widget('zii.widgets.CMenu', array(
                'items' => array(
                    array('label' => '默认排序', 'url' => array('channel/take'), 'active' => $_GET['sort'] == '','template' => '{menu}', 'itemOptions' => array('class' => 'normal')),
                    array('label' => '销量', 'url' => array('channel/take', 'sort' => 'saleCount',  'order' => $_GET['order'] == 'desc' ? 'asc' : 'desc', 'page' => $_GET['page'] ? $_GET['page'] : '1'), 'active' => $_GET['sort'] == 'saleCount'),
                    array('label' => '价格', 'url' => array('channel/take', 'sort' => 'skuPrice',  'order' => $_GET['order'] == 'desc' ? 'asc' : 'desc', 'page' => $_GET['page'] ? $_GET['page'] : '1'), 'active' => $_GET['sort'] == 'skuPrice'),
                    array('label' => '评价', 'url' => array('channel/take', 'sort' => 'commontCount',  'order' => $_GET['order'] == 'desc' ? 'asc' : 'desc', 'page' => $_GET['page'] ? $_GET['page'] : '1'), 'active' => $_GET['sort'] == 'commontCount'),
                ),
                'activeCssClass' => $_GET['order'] == 'desc' ? 'on' : 'on asc',
                'itemTemplate' => '{menu}<i class="cmicons"></i>'
            ));
            ?>
        </ul>
        <div class="y cl">
            <?php
            $this->widget('CLinkPager', array(
                'header' => '',
                'prevPageLabel' => '<i class="cmicons"></i>',
                'nextPageLabel' => '<i class="cmicons"></i>',
                'pages' => $pages,
                'cssFile' => false,
                'maxButtonCount' => 10,
                'id'=>'minpager',
                'htmlOptions' => array(
                    'class' => 'cl'
                )
                    )
            );
            ?>
        </div>
    </div>
    <ul class="foodlist cl tm10">
        <?php foreach ($model as $key => $value) { ?>
            <?php if ($value['status'] == 1) { ?>
                <li class="foodlayer" id="p<?php echo $value['id'];?>">
                    <div class="food_img">
                        <a href="<?php echo Yii::app()->createUrl('site/product',array('id' => $value['productSkuId'])); ?>">
                            <img src="<?php echo $value['productImg']['0']; ?>" align="absmiddle"/>
                        </a>
                    </div>
                    <div class="food_desc">
                        <p>￥<b><?php echo number_format($value['skuPrice'],2); ?></b><span>门店价&nbsp;<i><?php echo number_format($value['oriPrice'],2); ?></i></span></p>
                        <h4><a href="<?php echo Yii::app()->createUrl('site/product',array('id' => $value['productSkuId'])); ?>"><?php echo $value['name']; ?></a></h4>
                        <h3><a href="<?php echo Yii::app()->createUrl('search/index', array('k' => urlencode($value['restaurantName']))); ?>" target="_blank"><?php echo $value['restaurantName']; ?></a></h3>
                    </div>
                    <div class="food_footer cl">
                        <div class="z sellnum">已售<b><?php echo $value['saleCount']; ?></b></div>
                        <div class="y eva">
                            <a href="<?php echo Yii::app()->createUrl('site/product',array('id' => $value['productSkuId'],'#'=>'tab2')); ?>" class="cl">
                                <span class="y"><b><?php echo $value['commontCount']; ?></b>人评价</span>
                            </a>
                        </div>
                    </div>
                </li>
            <?php }
        }
        ?>
    </ul>
    <div class="pagebox">
        <?php
        $this->widget('CLinkPager', array(
            'header' => '',
            'firstPageLabel' => '首页',
            'lastPageLabel' => '末页',
            'prevPageLabel' => '上一页',
            'nextPageLabel' => '下一页',
            'pages' => $pages,
            'cssFile' => false,
            'maxButtonCount' => 13,
//            'itemsCssClass' => ''
            'htmlOptions' => array(
                'class' => 'cl'
            )
                )
        );
        ?>
    </div>
</div>